﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CascadeDropDown.Library.Component;
using System.Web.UI;

namespace CascadeDropDown.Helpers
{
    public class ViewModelHelper
    {
        public static void Run<TViewModel>(Control mainControl) where TViewModel : ViewModelBase<TViewModel>, new()
        {
            TViewModel viewModel = DataBindHelper.GetModel<TViewModel>(mainControl);
            viewModel.RunBussiness();
            DataBindHelper.ConfigureView(mainControl, viewModel);
        }
    }
}
